package com.zbfc.java;

import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class DownloadTaobao {
	public static void main(String[] args) throws IOException {
		URL url = new URL(
				"https://p.ssl.qhimg.com/dmfd/392_250_/t01c91798e45fc1182d.jpg");
		HttpURLConnection con = (HttpURLConnection) url.openConnection();
		BufferedInputStream bis = new BufferedInputStream(con.getInputStream());
		byte[] b = new byte[1024];
		FileOutputStream fos = new FileOutputStream("c://1.txt");
		int num;
		while ((num = bis.read(b)) != -1) {
			fos.write(b, 0, num);
		}
		fos.close();
		bis.close();

	}

}
